<!DOCTYPE html> 
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
<title>登录</title>
<link rel="icon" href="http://wz.yichengshi.cn/loginMobile/favicon.ico" type="image/x-icon"> 
<!--common begin--> 
<script type="text/javascript" src="${basePath}js/jquery-1.8.3.min.js" ></script>
<link href="${basePath}css/manager/mobile_login.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="${basePath}js/jquery.cookie.js"></script>
<style>
.yellowButton{font-style: normal;background-color: #E7E7E7;border: 1px solid #3ec3d5;color: #3ec3d5;}
</style>
</head>
<body style="background:#f7f7f7;">
<div id="logindiv">
 
<div class="header">登录<div class="fg"></div></div>
<div class="ZcBox">
  <div style="height:15px; overflow:hidden;"></div>
  <div class="bhbh"><input id="login_name" name="name" type="text" value="" placeholder="输入帐号" ></div>
  <div style="height:15px; overflow:hidden;"></div>
  <div class="bhbh"><input id="login_pass" name="pass" type="password" placeholder="输入密码" ></div>
  <div style="height:15px; overflow:hidden;"></div> 
  <div class="bhbh"><input  name="verifyCode" type="text" placeholder="验证码" style="width:70%" ><img id="verifyCode" src="${basePath }manager/Login_verifyCode" width="80px" height="32px" style="cursor: pointer;"></div>
  <div style="height:15px; overflow:hidden;"></div>  
</div>
<a href="javascript:void(0);" id="submitLoginForm" class="ZcBox_btn">登录</a>
  
</div>
<script type="text/javascript">
$(function(){

$('#verifyCode').click(function(){
		$('#verifyCode').attr('src','${basePath }manager/Login_verifyCode?m='+Math.random());
	});

$('#submitLoginForm').click(function(){
	login();
});

$('#login_name').val($.cookie('userName'));
$('#login_pass').val($.cookie('passWord'));  


function login(){

	var userName= $('#login_name').val();
	var passWord= $('#login_pass').val();
	var verifyCode =$('input[name=verifyCode]').val();

	if(null == userName || 'undefined'== userName || '' == userName){ 
		alert("用户名不能为空");
		return ;
	} 
	if(null == passWord || 'undefined'== passWord || '' == passWord){ 
		alert("密码不能为空");
		return ;
	}
	if(null == verifyCode || 'undefined'== verifyCode || '' == verifyCode){ 
		alert("验证码不能为空");
		return ;
	}
	
	$.ajax({ 
		url : "${basePath}manager/Login_login",
		data : { 
			userName : userName,
			passWord : passWord,
			verifyCode : verifyCode
		}, 
		dataType :"JSON",
		cache : false, 
		type : "POST",
		success : function(dat){
			if(dat.code==1){
				window.location.href="${basePath }manager/Login_index"; 
				//window.location.href="${basePath }manager/PurchaseSaleOrder_saleOrderProductListPage";
				$.cookie('userName',userName,{expires:7}); 
				$.cookie('passWord',passWord,{expires:7});  
			}else if(dat.code==0){
				alert(dat.msg);
			} 	
			$('#verifyCode').attr('src','${basePath }manager/Login_verifyCode?m='+Math.random());
		}
	});
}
	
	
});
</script> 
</body>
</html>